/* mac lookup tool */

#include <stdio.h>
#include <string.h>
#include "data.c"
#include "functions.c"


int main(int argc, char **argv)
{

	if(argc != 2) {
		print_usage();
		return 1;
	}	
	
	int mlen = strlen(argv[1]);
	if(mlen > 12) {
		error_msg(0);
		return 1;
	}
	
	
	int i,y = 0;
	for(i=0;i<1312;i++){ //fix size of db
		if(strncmp(d1[i].mac,argv[1],mlen) == 0){ 
			printf("%s\n",d1[i].ssid);
			y++; // insgesamt
			
			
			
		}
	}
	
	printf("Found %i Router with similar MAC address\n",y);
	
	
	
		//printf ("argv 1 = %s\n",argv[1]);
		//printf("ssid 0 =%c\n",d1[0].ssid[1]);
		//printf("%i",mlen);
	return 0;
}

